﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SaveAWatt.GUI;
using System.Windows.Forms;
using System.Threading;

namespace GUITestCarrier
{
    class Program
    {
        public static void Main(string[] args)
        {
            Form1 sForm1 = new Form1();
            Thread x = new Thread(runGUI);
            x.Start(sForm1);

            // Will be in a list later.
            GUIemm testEMM1 = new GUIemm("UV-34429");
            GUIemm testEMM2 = new GUIemm("UV-22357");
            GUIemm testEMM3 = new GUIemm("UU-93821");

            // Crashes here due to another thread being the creator of the form.
            sForm1.addToList(testEMM1);
        }

        public static void runGUI(object form)
        {
            Form1 sForm1 = (Form1)form;
            sForm1.ShowDialog();
            sForm1.addToList(new GUIemm("lala"));
        }
    }
}
